#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef double db;

#define in read()
#define pii pair<int,int>
#define fi first
#define se second
#define FILE(x) freopen(x".in","r",stdin);\
	freopen(x".out","w",stdout);
#define pb push_back

int read(){
	int x = 0,sgn = 1;char ch = getchar();
	for(;!isdigit(ch);ch = getchar()) if(ch == '-') sgn = -1;
	for(;isdigit(ch);ch = getchar()) x = (x<<1)+(x<<3)+(ch^48);
	return x*sgn;
}

const int N = 1e5+10;

int n,m,h[N],need,cnt,rt;
struct edge{int v,nxt;}e[N<<1];
void link(int x,int y){e[++cnt] = (edge){y,h[x]};h[x] = cnt;}
bool vis[N],v[N<<1],req[N];
vector<int> cur,ans;

void dfs(int x){
	if(req[x]) need = 1;
	cur.pb(x); vis[x] = 1; req[x] ^= 1;
	for(int i = h[x],y;i;i = e[i].nxt){
		if(vis[y = e[i].v]) continue;
		dfs(y); cur.pb(x); req[x] ^= 1; if(req[y] == 1) req[y] ^= 1,req[x] ^= 1,cur.pb(y),cur.pb(x);
	}
	if(x == rt && req[x] == 1) cur.pop_back();
}

int main (){
#ifndef ONLINE_JUDGE
	freopen("1.in","r",stdin);
#endif
	n = in,m = in;
	for(int i = 1,u,v;i <= m;i++){
		u = in,v = in; link(u,v); link(v,u);
	}
	for(int i = 1;i <= n;i++) req[i] = in;
	int tot = 0;
	for(int i = 1;i <= n;i++)
		if(!vis[i]) {
			cur.clear(); rt = i; need = 0; dfs(i);
			if(need) tot++,ans = cur; if(tot > 1) return puts("-1"),0;
		}
	printf("%lu\n",ans.size()); for(int x : ans) printf("%d ",x); puts("");
	return 0;
}

